#ifndef LAURIN_NETWORK_DEVICE_H_
#define LAURIN_NETWORK_DEVICE_H_

#include "laurin-device.h"
#include "laurin-capture-interface.h"
#include "laurin-ip-network.h"
#include "laurin-utils.h"
#include <glibmm/ustring.h>
#include <libnet.h>

class LaurinNetworkDevice : public LaurinDevice, public LaurinCaptureInterface
{
	public:

		LaurinNetworkDevice(const Glib::ustring& ifaceName);
		virtual ~LaurinNetworkDevice();

		bool isInitialized() const;

		u_int32_t getIP() const;
		u_int8_t* getMAC() const;

		libnet_t* getInjectionContext() const;

		LaurinIPNetwork* getNetwork() const;


	protected:

		virtual bool setCaptureOptions();


	private:

		libnet_t* _injectionContext;
		LaurinIPNetwork* _network;
		u_int32_t _ip;
		u_int8_t* _mac;
		bool _ready;


		bool openInjectionContext();
		void closeInjectionContext();
};

#endif
